﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.Data.Objects;
using System.Data.Objects.DataClasses;

namespace DataAccess
{
    interface IDBContext
    {

        #region Basic Data Access method

        void Submit();

        void InsertObject(Object newObj);
        void UpdateObject(Object existedObj);
        void DeleteObject(Object existedObj);

        void BeginTransaction();
        void CommitTransaction();
        void RollBackTransaction();

        void ExecuteSQLNonQuery(string sql);
        List<T> ExecuteSQLQuery<T>(string sql);
        DataTable ExecuteSQLQuery(string sql);

        void ExecuteStoreProcedure(string spName, params SqlParameter[] spParameters);
        List<T> ExecuteQueryStoreProcedure<T>(string spName, params SqlParameter[] spParameters);
        DataTable ExecuteQueryStoreProcedure(string spName, params SqlParameter[] spParameters);

        void FinalizeContext();

        #endregion

        ObjectContext GetContext();

        #region Query

        #endregion

    }
}
